#!/usr/bin/env bash

# expected results: Create: 0 Parse: 1 parse: 1 Execute: 1 Parse: 1 Execute: 1 Parse: 1 Execute: 1
# Parse: 1 Execute: 1
# Parse: 1 Execute: 1 Parse: 1 Execute: 1
set 0 1 1 1 1 1 1 1 1 1 1 1 1 1

grep "SELECT" $PGPOOLLOG | grep -v version | grep -v pg_sleep | awk '{print $9}' | while read node
do
    if [ $1 -ne $node ]
    then
	echo "expected: $1 result: $node"
	exit 99
    fi
    shift
done

if [ $? = 99 ]
then
   exit 1
fi

exit 0

